<template>
  <div  class="tplWrap">
    <div :style="`padding-top: ${paddingTopPx}`">
      <div class="no-margin">
        <div v-for="(item, index) in tplData" :key="index">
          <!-- 模版1 -->
          <tpl-header1 v-if="item.type == 'Header_style1'" :tplItemData="item.content" :shopTitle="shopTitle"></tpl-header1>
          <!-- 模版2、19、8、21 -->
          <tpl-header2 v-else-if="item.type == 'Header_style2' || item.type == 'Header_style8' || item.type == 'Header_style19' || item.type == 'Header_style21_new'" :type="item.type" :tplItemData="item.content"></tpl-header2>
          <!-- 模版7 -->
          <tpl-header7 v-else-if="item.type == 'Header_style7'" :tplItemData="item.content" :shopTitle="shopTitle"></tpl-header7>
          <!-- 模版9 -->
          <tpl-header9 v-else-if="item.type == 'Header_style9'" :tplItemData="item.content" :shopTitle="shopTitle"></tpl-header9>
          <!-- 模版12 -->
          <tpl-header15 v-else-if="item.type == 'Header_style12'" :tplItemData="item.content" :shopTitle="shopTitle"></tpl-header15>
          <!-- 模版13 -->
          <tpl-header13 v-else-if="item.type == 'Header_style13'" :tplItemData="item.content"></tpl-header13>
          <!-- 模版15 -->
          <tpl-header15 v-else-if="item.type == 'Header_style15'" :tplItemData="item.content" :shopTitle="shopTitle"></tpl-header15>
          <!-- 模版18、6号模板新头部 -->
          <tpl-header18 v-else-if="item.type == 'Header_style18' || item.type =='Header_style6_new'" :type="item.type" :tplItemData="item.content"></tpl-header18>
          <!-- 模板20 -->
          <tpl-header20 v-else-if="item.type == 'Header_style20'" :tplItemData="item.content"></tpl-header20>
          <!-- 模版41 -->
          <tpl-header41 v-else-if="item.type == 'Header_style50'" :tplItemData="item.content"></tpl-header41>
          <!-- 图片导航组件不可拖动 -->
          <img-adv v-else-if="item.type ==9 && item.draggable==0" :tplItemData="item.content"></img-adv>
          <!-- 模版46 -->
          <tpl-header46 v-else-if="item.type == 'Header_style63_swiper'" :tplItemData="item.content"></tpl-header46>
          <!-- 模版47 -->
          <tpl-header47 v-if="item.type == 'Header_style64_hybird'" :tplItemData="item.content"></tpl-header47>
          <!-- 模版48 -->
          <tpl-header48 v-if="item.type == 'Header_style65_swiper'" :tplItemData="item.content"></tpl-header48>
          <!-- 模版49 -->
          <tpl-header49 v-if="item.type == 'Header_style68'" :tplItemData="item.content"></tpl-header49>
        </div>
      </div>
      <div class="fixed-box" :style="{'top': itemGroupPadding}">
        <div v-for="(item, index) in tplData" :key="index">
          <!-- 模版26 -->
          <tpl-search26 v-if="item.type == 'Header_style26_select'" :tplItemData="item.content"></tpl-search26>
          <tpl-nav26 v-else-if="item.type == 'Header_style26_nav'" :tplItemData="item.content"></tpl-nav26>
          <!-- 模板29 -->
          <tpl-header29 v-else-if="item.type == 'Header_style29_hybird'" :tplItemData="item.content"></tpl-header29>
          <!-- 模板33 -->
          <tpl-header33 v-else-if="item.type == 'Header_style33'" :tplItemData="item.content"></tpl-header33>
          <!-- 模板37 -->
          <tpl-header37 v-else-if="item.type == 'Header_style46'" :tplItemData="item.content"></tpl-header37>
          <!-- 模版38 -->
          <tpl-header38 v-else-if="item.type == 'Header_style47'" :tplItemData="item.content" :supplierId="supplierId"></tpl-header38>
          <!-- 模版39 -->
          <tpl-header39 v-else-if="item.type == 'Header_style48'" :tplItemData="item.content"></tpl-header39>
          <!-- 模版42 -->
          <tpl-header42 v-else-if="item.type == 'Header_style51'" :tplItemData="item.content" :cityName="cityName" @getcityName="getcityNameFu" @getLocationType="getLocationTypeFun"></tpl-header42>
          <!-- 模版43 -->
          <tpl-search43 v-else-if="item.type == 'Header_style52_select'" :tplItemData="item.content"></tpl-search43>
          <tpl-nav43 v-else-if="item.type == 'Header_style52_nav'" :tplItemData="item.content"></tpl-nav43>
          <!-- 模版45 -->
          <tpl-header45 v-else-if="item.type == 'Header_style62_hybrid'" :tplItemData="item.content"></tpl-header45>
          <slide-top-nav v-else-if="item.type ==23 && $route.name != 'storeIndex'" :tplItemData="item.content"></slide-top-nav>
        </div>
      </div>
      <div :class="['no-margin',hasMargin==1?'magrin':'']">
        <div v-for="(item, index) in tplData" :key="index">
          <diy-audio v-if="item.type ==15" :tplItemData="item.content"></diy-audio>
          <blank v-else-if="item.type ==11" :tplItemData="item.content"></blank>
          <bulletin v-else-if="item.type ==16" :tplItemData="item.content" ></bulletin>
          <card-list v-else-if="item.type ==21" :tplItemData="item.content"></card-list>
          <community v-else-if="item.type ==29" :tplItemData="item.content"></community>
          <cut-line v-else-if="item.type ==10" :tplItemData="item.content"></cut-line>
          <diy-module v-else-if="item.type ==3" :tplItemData="item.content"></diy-module>
          <editor v-else-if="item.type ==1" :tplItemData="item.content"></editor>
          <goods v-else-if="item.type ==4" :tplItemData="item.content" :tplAllData="item" :tplId="tplId"></goods>
          <goods-cate v-else-if="item.type ==17" :tplItemData="item.content"></goods-cate>
          <goods-list v-else-if="item.type ==5" :tplItemData="item.content"></goods-list>
          <goods-promotion v-else-if="item.type ==38" :tplItemData="item.content"></goods-promotion>
          <goods-sales v-else-if="item.type ==20 && JSON.stringify(item.content) != '{}'" :tplItemData="item.content"></goods-sales>
          <goods-search v-else-if="item.type ==6" :tplItemData="item.content"></goods-search>
          <img-adv v-else-if="item.type ==9 && item.draggable==1" :tplItemData="item.content"></img-adv>
          <img-nav v-else-if="item.type ==8" :tplItemData="item.content"></img-nav>
          <min-type v-else-if="item.type ==18" :tplItemData="item.content"></min-type>
          <pd-living v-else-if="item.type ==30" :tplItemData="item.content"></pd-living>
          <wx-living v-else-if="item.type ==33" :tplItemData="item.content"></wx-living>
          <wx-living-copy v-else-if="item.type ==37" :tplItemData="item.content"></wx-living-copy>
          <point-exchange v-else-if="item.type ==27" :tplItemData="item.content"></point-exchange>
          <pre-sell v-else-if="item.type ==31" :tplItemData="item.content"></pre-sell>
          <reco-goods v-else-if="item.type ==19" :tplItemData="item.content"></reco-goods>
          <sec-kill v-else-if="item.type ==28" :tplItemData="item.content"></sec-kill>
          <showcase v-else-if="item.type ==13" :tplItemData="item.content"></showcase>
          <slide-nav v-else-if="item.type ==22" :tplItemData="item.content"></slide-nav>
          <store  v-else-if="item.type ==25" :tplItemData="item.content"></store>
          <text-nav v-else-if="item.type ==7" :tplItemData="item.content"></text-nav>
          <title-tpl v-else-if="item.type ==2" :tplItemData="item.content"></title-tpl>
          <top-menu v-else-if="item.type ==12" :tplItemData="item.content"></top-menu>
          <diy-video v-else-if="item.type ==14" :tplItemData="item.content" :vid="item.id"></diy-video>
          <roll-Img v-else-if="item.type ==41" :tplItemData="item.content"></roll-Img>
          <live-list v-else-if="item.type ==44" :tplItemData="item.content" :type="item.type"></live-list>
          <live-list v-else-if="item.type ==55" :tplItemData="item.content" :type="item.type"></live-list>
          <live-list v-else-if="item.type ==54" :tplItemData="item.content" :type="item.type"></live-list>
          <share-img v-else-if="item.type ==45" :tplItemData="item.content"></share-img>
          <!-- 特色专区 -->
          <featured-zone v-else-if="item.type ==51" :tplItemData="item.content"></featured-zone>
          <!-- 新模板公共组件 -->
          <new-search-nav v-else-if="item.type == 56" :tplItemData="item.content"></new-search-nav>

          <!-- 关注公众号组件 -->
          <wx-gzh v-else-if="item.type =='36'" :tplItemData="item.content"></wx-gzh>
          <!-- 公众号文章组件 -->
          <wxgzh-articles v-else-if="item.type ==39" :tplItemData="item.content"></wxgzh-articles>
          <!-- 跳转小程序组件 -->
          <xcx-link v-else-if="item.type ==40" :tplItemData="item.content"></xcx-link>

          <city-main v-else-if="item.type ==26" :tplItemData="item.content" :cityName="cityName" :locationType="locationType"></city-main>
          <limit-activity v-else-if="item.type ==42" :tplItemData="item.content" :tplId="tplId"></limit-activity>
          <!-- 首页模版装修组件 -->
          <!-- 模版1 -->
          <showcase v-else-if="item.type =='Header_style1_activity'" :tplItemData="item.content"></showcase>
          <!-- 模板7 -->
          <tpl-slider-goods7 v-else-if="item.type =='Header_style7_largeLunbo'" :tplItemData="item.content"></tpl-slider-goods7>
          <!-- 模版12 -->
          <tpl-nav12 v-else-if="item.type == 'Header_style12_nav'" :tplItemData="item.content"></tpl-nav12>
          <!-- 模版16 -->
          <tpl-top16 v-else-if="item.type == 'Header_style16_top'" :tplItemData="item.content"></tpl-top16>
          <tpl-nav16 v-else-if="item.type == 'Header_style16_nav'" :tplItemData="item.content"></tpl-nav16>
          <tpl-swiper16 v-else-if="item.type == 'Header_style16_hybrid'" :tplItemData="item.content"></tpl-swiper16>
          <tpl-title16 v-else-if="item.type == 'Header_style16_diytitle'" :tplItemData="item.content"></tpl-title16>
          <tpl-goods16 v-else-if="item.type == 'Header_style16_goods'" :tplItemData="item.content"></tpl-goods16>
          <!-- 模版20 -->
          <tpl-top20 v-else-if="item.type == 'Header_style20_top'" :tplItemData="item.content"></tpl-top20>
          <tpl-bottom20 v-else-if="item.type == 'Header_style20_bottomNav'" :tplItemData="item.content"></tpl-bottom20>
          <tpl-nav20 v-else-if="item.type == 'Header_style20_imgNav'" :tplItemData="item.content"></tpl-nav20>
          <!-- 模版22 -->
          <tpl-activity22 v-else-if="item.type =='Header_style22_activity'" :tplItemData="item.content"></tpl-activity22>
          <!-- 模版23 -->
          <tpl-header23 v-else-if="item.type == 'Header_style23_hybrid'" :tplItemData="item.content"></tpl-header23>
          <tpl-goods23 v-else-if="item.type == 'Header_style23_goods'" :tplItemData="item.content"></tpl-goods23>
          <!-- 模版26 -->
          <tpl-activity26 v-else-if="item.type == 'Header_style26_activity'" :tplItemData="item.content"></tpl-activity26>
          <!-- 模板29 -->
          <tpl-imgAdv29 v-else-if="item.type == 'Header_style29_hybird'" :tplItemData="item.content"></tpl-imgAdv29>
          <tpl-activity29 v-else-if="item.type == 'Header_style29_activity'" :tplItemData="item.content"></tpl-activity29>
          <tpl-nav29 v-else-if="item.type == 'Header_style29_nav'" :tplItemData="item.content"></tpl-nav29>
          <!-- 模版31 -->
          <tpl-nav31 v-else-if="item.type == 'Header_style31_nav'" :tplItemData="item.content"></tpl-nav31>
          <!-- 模板标题组件整合  31、33、9、37-->
          <tpl-title31 v-else-if="item.type == 'Header_style31_diytitle' || item.type == 'Header_style33_diytitle' || item.type == 'Header_style9_diytitle' || item.type == 'Header_style46_diytitle'" :type="item.type" :tplItemData="item.content"></tpl-title31>
          <!-- 模版32 -->
          <tpl-activity32 v-else-if="item.type =='Header_style32_activity'" :tplItemData="item.content"></tpl-activity32>
          <!-- 模板33 -->
          <tpl-imgAdv33 v-else-if="item.type == 'Header_style33'" :tplItemData="item.content"></tpl-imgAdv33>
          <!-- 模板34 -->
          <tpl-img-title34 v-else-if="item.type == 'Header_style34_imgTitle'" :tplItemData="item.content"></tpl-img-title34>
          <!-- 模板37 -->
          <tpl-imgAdv37 v-else-if="item.type == 'Header_style46'" :tplItemData="item.content"></tpl-imgAdv37>
          <tpl-nav37 v-else-if="item.type == 'Header_style46_nav'" :tplItemData="item.content"></tpl-nav37>
          <tpl-activity37 v-else-if="item.type == 'Header_style46_activity'" :tplItemData="item.content"></tpl-activity37>
          <tpl-goods37 v-else-if="item.type == 'Header_style46_Newgoods'" :tplItemData="item.content"></tpl-goods37>
          <!-- 模版38 -->
          <tpl-imgAdv38 v-else-if="item.type == 'Header_style47'" :tplItemData="item.content"></tpl-imgAdv38>
          <tpl-title38 v-else-if="item.type == 'Header_style47_diytitle'" :tplItemData="item.content"></tpl-title38>
          <tpl-img38 v-else-if="item.type == 'Header_style47_img'" :tplItemData="item.content"></tpl-img38>
          <tpl-img238 v-else-if="item.type == 'Header_style47_img02'" :tplItemData="item.content"></tpl-img238>
          <!-- 模版39 -->
          <tpl-imgAdv39 v-else-if="item.type == 'Header_style48'" :tplItemData="item.content"></tpl-imgAdv39>
          <tpl-goods39 v-else-if="item.type == 'Header_style48_goods'" :tplItemData="item.content"></tpl-goods39>
          <!-- 模版42 -->
          <tpl-imgAdv42 v-else-if="item.type == 'Header_style51'" :tplItemData="item.content" ></tpl-imgAdv42>
          <tpl-spell-group42 v-else-if="item.type == 'Header_style53_groups'" :tplItemData="item.content"></tpl-spell-group42>
          <!-- 模版43 -->
          <tpl-swiper43 v-else-if="item.type == 'Header_style52_hybrid'" :tplItemData="item.content"></tpl-swiper43>
          <tpl-recommend43 v-else-if="item.type == 'Header_style52_recommend'" :tplItemData="item.content"></tpl-recommend43>
          <tpl-sale43 v-else-if="item.type == 'Header_style52_sale'" :tplItemData="item.content"></tpl-sale43>
          <!-- 模版44 -->
          <tpl-swiper44 v-else-if="item.type == 'Header_style53_slider'" :tplItemData="item.content"></tpl-swiper44>
          <tpl-nav44 v-else-if="item.type == 'Header_style53_nav'" :tplItemData="item.content"></tpl-nav44>
          <tpl-adv44 v-else-if="item.type == 'Header_style53_ad'" :tplItemData="item.content"></tpl-adv44>
          <tpl-exhibit44 v-else-if="item.type == 'Header_style53_exhibit'" :tplItemData="item.content"></tpl-exhibit44>
          <!-- 模版45 -->
          <tpl-imgAdv45 v-else-if="item.type == 'Header_style62_hybrid'" :tplItemData="item.content"></tpl-imgAdv45>
          <tpl-title45 v-else-if="item.type == 'Header_style62_diytitle'" :tplItemData="item.content"></tpl-title45>
          <tpl-slide-nav45 v-else-if="item.type == 'Header_style62_diyslidenav'" :tplItemData="item.content"></tpl-slide-nav45>
      
          <!-- 模版46 -->
          <tpl-hot-goods46 v-else-if="item.type == 'Header_style63_hotgoods'" :tplItemData="item.content"></tpl-hot-goods46>
          <tpl-hybird46 v-else-if="item.type == 'Header_style63_hybird'" :tplItemData="item.content"></tpl-hybird46>
          <!-- 模版47 -->
          <tpl-hot-sale47 v-else-if="item.type == 'Header_style64_hotSale'" :tplItemData="item.content"></tpl-hot-sale47>
          <!-- 模版48 -->
          <tpl-img48 v-else-if="item.type == 'Header_style65_img'" :tplItemData="item.content"></tpl-img48>
          <tpl-hybird48 v-else-if="item.type == 'Header_style65_hybird'" :tplItemData="item.content"></tpl-hybird48>
          <!-- 模版49 -->
          <tpl-ad49 v-else-if="item.type == 'Header_style68_ad'" :tplItemData="item.content"></tpl-ad49>
        </div>
      </div>
    </div>
    
  </div>
</template>

<script>
import diyAudio from '@/components/diyTpl/decoration/audio'
import blank from '@/components/diyTpl/decoration/blank'
import bulletin from '@/components/diyTpl/decoration/bulletin'
import cardList from '@/components/diyTpl/decoration/cardList' // 卡片列表组件
import community from '@/components/diyTpl/decoration/community'
import cutLine from '@/components/diyTpl/decoration/cutLine'
import diyModule from '@/components/diyTpl/decoration/diyModule' // 自定义模块组件
import editor from '@/components/diyTpl/decoration/editor'
import goods from '@/components/diyTpl/decoration/goods' // 商品组件
import goodsCate from '@/components/diyTpl/decoration/goodsCate'
import goodsList from '@/components/diyTpl/decoration/goodsList'
import goodsPromotion from '@/components/diyTpl/decoration/goodsPromotion' // 推广组件
import goodsSales from '@/components/diyTpl/decoration/goodsSales' // 商品促销组件
import goodsSearch from '@/components/diyTpl/decoration/goodsSearch'
import imgAdv from '@/components/diyTpl/decoration/imgAdv'
import imgNav from '@/components/diyTpl/decoration/imgNav'
import minType from '@/components/diyTpl/decoration/minType'
import pdLiving from '@/components/diyTpl/decoration/pdLiving'
import wxLiving from '@/components/diyTpl/decoration/wxLiving'
import wxLivingCopy from '@/components/diyTpl/decoration/wxLivingCopy'
import pointExchange from '@/components/diyTpl/decoration/pointExchange'
import preSell from '@/components/diyTpl/decoration/preSell'
import recoGoods from '@/components/diyTpl/decoration/recoGoods' // 推荐商品组件
import secKill from '@/components/diyTpl/decoration/secKill' // 秒杀活动组件
import showcase from '@/components/diyTpl/decoration/showcase'
import slideNav from '@/components/diyTpl/decoration/slideNav'
import slideTopNav from '@/components/diyTpl/decoration/slideTopNav'
import store from '@/components/diyTpl/decoration/store'
import textNav from '@/components/diyTpl/decoration/textNav'
import titleTpl from '@/components/diyTpl/decoration/title'
import topMenu from '@/components/diyTpl/decoration/topMenu'
import diyVideo from '@/components/diyTpl/decoration/video'
import rollImg from '@/components/diyTpl/decoration/rollImg'
import wxGzh from '@/components/diyTpl/decoration/wxGzh'
import wxgzhArticles from '@/components/diyTpl/decoration/wxgzhArticles'
import xcxLink from '@/components/diyTpl/decoration/xcxLink'
import limitActivity from '@/components/diyTpl/decoration/limitActivity'
import liveList from '@/components/diyTpl/decoration/liveList'
import shareImg from '@/components/diyTpl/decoration/shareImg'
import featuredZone from '@/components/diyTpl/decoration/featuredZone'
import newSearchNav from '@/components/diyTpl/decoration/newSearchNav'

import Vue from 'vue'

// TODO 装修模板
import cityMain from '@/components/diyTpl/decoration/cityMain'
import tplHeader1 from './tpl1/header'
import tplHeader2 from './tpl2/header'
import tplHeader7 from './tpl7/header'
import tplHeader9 from './tpl9/header'
import tplSliderGoods7 from './tpl7/sliderGoods'
import tplNav12 from './tpl12/nav'
import tplHeader13 from './tpl13/header'
import tplHeader15 from './tpl15/header'
import tplTop16 from './tpl16/top'
import tplNav16 from './tpl16/nav'
import tplSwiper16 from './tpl16/swiper'
import tplTitle16 from './tpl16/diytitle'
import tplGoods16 from './tpl16/goods'
import tplHeader18 from './tpl18/header'
import tplHeader20 from './tpl20/header'
import tplTop20 from './tpl20/top'
import tplBottom20 from './tpl20/bottom'
import tplNav20 from './tpl20/nav'
import tplActivity22 from './tpl22/activity'
import tplHeader23 from './tpl23/header'
import tplGoods23 from './tpl23/goods'
import tplSearch26 from './tpl26/search'
import tplActivity26 from './tpl26/activity'
import tplHeader29 from './tpl29/header'
import tplImgAdv29 from './tpl29/imgAdv'
import tplNav26 from './tpl26/nav'
import tplActivity29 from './tpl29/activity'
import tplNav29 from './tpl29/nav'
import tplNav31 from './tpl31/nav'
import tplTitle31 from './tpl31/diytitle'
import tplActivity32 from './tpl32/activity'
import tplHeader33 from './tpl33/header'
import tplImgAdv33 from './tpl33/imgAdv'
import tplImgTitle34 from './tpl34/imgTitle'
import tplHeader37 from './tpl37/header'
import tplImgAdv37 from './tpl37/imgAdv'
import tplNav37 from './tpl37/nav'
import tplActivity37 from './tpl37/activity'
import tplGoods37 from './tpl37/goods'
import tplHeader38 from './tpl38/header'
import tplImgAdv38 from './tpl38/imgAdv'
import tplTitle38 from './tpl38/title'
import tplImg38 from './tpl38/img'
import tplImg238 from './tpl38/img2'
import tplHeader39 from './tpl39/header'
import tplImgAdv39 from './tpl39/imgAdv'
import tplGoods39 from './tpl39/goods'
import tplHeader41 from './tpl41/header'
import tplHeader42 from './tpl42/header'
import tplImgAdv42 from './tpl42/imgAdv'
import tplSpellGroup42 from './tpl42/spellGroup'
import tplSearch43 from './tpl43/search'
import tplSwiper43 from './tpl43/swiper'
import tplNav43 from './tpl43/nav'
import tplRecommend43 from './tpl43/recommend'
import tplSale43 from './tpl43/sale'
import tplSwiper44 from './tpl44/swiper'
import tplNav44 from './tpl44/nav'
import tplAdv44 from './tpl44/adv'
import tplExhibit44 from './tpl44/exhibit'
import tplHeader45 from './tpl45/header'
import tplImgAdv45 from './tpl45/imgAdv'
import tplTitle45 from './tpl45/title'
import tplSlideNav45 from './tpl45/slideNav'
import tplHeader46 from './tpl46/header'
import tplHotGoods46 from './tpl46/hotGoods'
import tplHybird46 from './tpl46/hybird'
import tplHeader47 from './tpl47/header'
import tplHotSale47 from './tpl47/hotSale'
import tplHeader48 from './tpl48/header'
import tplHybird48 from './tpl48/hybird'
import tplImg48 from './tpl48/img'
import tplHeader49 from './tpl49/header'
import tplAd49 from './tpl49/ad'

export default Vue.extend({
  props: {
    tplData: {
      type: Array,
      default() {
        return []
      }
    },
    tplId: {
      type: [Number, String],
      default: 0
    },
    itemGroupPadding: {
      type: [Number, String],
      default: ''
    },
    hasMargin: {
      type: [Number, String],
      default: 0
    },
    shopTitle: {
      type: String,
      default: ''
    },
    supplierId: {
      type: [Number, String]
    }
  },
  data() {
    return {
      paddingTopNum: 0,
      paddingTopPx: 0,
      cityName: '',
      locationType: ''
    }
  },
  watch: {
    tplData() {
      this.publicPaddingTop()
      this.ProcessingLoading();
    }
  },
  mounted() {
    // console.log('***shoptpl-supplierId', this.supplierId)
    this.publicPaddingTop()
    this.ProcessingLoading();
  },
  methods: {
    publicPaddingTop() {
      if(this.$route.name=="storeIndex"){
        this.paddingTopPx = 10 + 'px'
        return false;
      }
      let paddingTopNum = 0
      const tplData = this.tplData
      tplData.forEach(item => {
        if (item.type == 23) { // 置顶滑动导航
          paddingTopNum += 88
        } else if (item.type == 'Header_style26_select') {
          paddingTopNum += 188
        } else if (item.type == 'Header_style52_select') {
          paddingTopNum += 108
        } else if (item.type == 'Header_style52_nav') {
          paddingTopNum += 80
        } else if (item.type == 'Header_style51') {
          if ((item.content.showLocation != 2 || !item.content.showLocation) || (item.content.showSearch != 2 || !item.content.showSearch) || item.content.showStore == 1) {
            if (item.content.showStore == 1 && ((item.content.showLocation != 2 || !item.content.showLocation) || (item.content.showSearch != 2 || !item.content.showSearch))) {
              paddingTopNum += 154
            } else {
              paddingTopNum += 84
            }
          } else {
            paddingTopNum += 20
          }
        } else if (item.type == 'Header_style33') {
          paddingTopNum += 84
        } else if (item.type == 'Header_style46') {
          paddingTopNum += 98
        } else if (item.type == 'Header_style29_hybird') {
          if (item.content.datasetNav && item.content.datasetNav.length > 0) {
            paddingTopNum += 160
          } else {
            paddingTopNum += 86
          }
        } else if (item.type == 'Header_style48') {
          if (item.content.datasetNav && item.content.datasetNav.length > 0) {
            paddingTopNum += 170
          } else {
            paddingTopNum += 100
          }
        }
      })
      // TODO 小程序处理单位
        this.paddingTopNum = paddingTopNum / 2
        this.paddingTopPx = this.paddingTopNum + 'px'
    },
    // 处理首页视频数据
    ProcessingLoading() {
      let videoSort = 0;
      let tplData = this.tplData
      // console.log('ProcessingLoading.....', tplData)
      for (let i = 0; i < tplData.length; i++) {
        if (tplData[i].type == 14) {
          if (typeof isPlayArr === "undefined") {
            var isPlayArr = [];
          }
          isPlayArr[videoSort] = false;
          tplData[i].content.videoSort = videoSort;
          videoSort++;
          tplData[i].content.isPlayArr = isPlayArr;
          // console.log('ProcessingLoading.....tplData', tplData[i])
        }
      }
      this.tplData = tplData
    },
    // 42套模板获取地址
    getcityNameFu(val) {
      this.cityName = val
    },
    getLocationTypeFun(val) {
      this.locationType = val
    }
  },
  components: {
    diyAudio,
    blank,
    bulletin,
    cardList,
    community,
    cutLine,
    diyModule,
    editor,
    goods,
    goodsCate,
    goodsList,
    goodsPromotion,
    goodsSales,
    goodsSearch,
    imgAdv,
    imgNav,
    minType,
    pdLiving,
    wxLiving,
    wxLivingCopy,
    pointExchange,
    preSell,
    recoGoods,
    secKill,
    showcase,
    slideNav,
    slideTopNav,
    store,
    textNav,
    titleTpl,
    topMenu,
    diyVideo,
    rollImg,
    wxGzh,
    wxgzhArticles,
    xcxLink,
    cityMain,
    tplHeader1,
    tplHeader2,
    tplHeader7,
    tplHeader9,
    tplSliderGoods7,
    tplNav12,
    tplHeader13,
    tplHeader15,
    tplTop16,
    tplNav16,
    tplSwiper16,
    tplTitle16,
    tplGoods16,
    tplHeader18,
    tplHeader20,
    tplTop20,
    tplBottom20,
    tplNav20,
    tplActivity22,
    tplHeader23,
    tplGoods23,
    tplSearch26,
    tplNav26,
    tplActivity26,
    tplHeader29,
    tplImgAdv29,
    tplActivity29,
    tplNav29,
    tplNav31,
    tplTitle31,
    tplActivity32,
    tplHeader33,
    tplImgAdv33,
    tplImgTitle34,
    tplHeader37,
    tplImgAdv37,
    tplNav37,
    tplActivity37,
    tplGoods37,
    tplHeader38,
    tplImgAdv38,
    tplTitle38,
    tplImg38,
    tplImg238,
    tplHeader39,
    tplImgAdv39,
    tplGoods39,
    tplHeader41,
    tplHeader42,
    tplImgAdv42,
    tplSpellGroup42,
    tplSearch43,
    tplNav43,
    tplSwiper43,
    tplRecommend43,
    tplSale43,
    tplSwiper44,
    tplNav44,
    tplAdv44,
    tplExhibit44,
    tplHeader45,
    tplTitle45,
    tplSlideNav45,
    tplImgAdv45,
    tplHeader46,
    tplHotGoods46,
    tplHybird46,
    tplHeader47,
    tplHotSale47,
    tplHeader48,
    tplHybird48,
    tplImg48,
    tplHeader49,
    tplAd49,
    limitActivity,
    liveList,
    shareImg,
    featuredZone,
    newSearchNav
  }
})
</script>

<style lang="scss">
.no-margin{
  &.magrin{
    margin: 0 20px;
  }
}
.fixed-box{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
}
</style>
